﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;

namespace Zxb.DayWork.Logic
{
    public class Constant
    {
        private static object lockobj = new object();
        private static Dictionary<NorthSouth, NSConfig> dicNorthSouth = null;

        public static Dictionary<NorthSouth, NSConfig> DicNorthSouth
        {
            get
            {
                if (dicNorthSouth == null)
                {
                    lock (lockobj)
                    {
                        if (dicNorthSouth == null)
                        {
                            dicNorthSouth = new Dictionary<NorthSouth, NSConfig>();
                            dicNorthSouth.Add(NorthSouth.North, new NSConfig() 
                            {
                                StatusName_AvgPrice="proj_price_North更新楼盘平均价格,已处理的最大ID",
                                StatusName = "proj_info_North新房楼盘表,已导入最大ID", 
                                DataBase = DB.EstateReaderNorth 
                            });
                            dicNorthSouth.Add(NorthSouth.South, new NSConfig()
                            {
                                StatusName_AvgPrice = "proj_price_South更新楼盘平均价格,已处理的最大ID",
                                StatusName = "proj_info_South新房楼盘表,已导入最大ID",
                                DataBase = DB.EstateReaderSouth 
                            });
                        }
                    }
                }
                return dicNorthSouth;
            }
        }
    }

    public class NSConfig
    {
        public string StatusName_AvgPrice;
        public string StatusName;
        public Database DataBase;
    }

    public enum NorthSouth
    {
        North = 1,
        South = 2
    }
}
